package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.entity.NursingProject;
import com.zzyl.mapper.CustomerElderMapper;
import com.zzyl.service.CustomerElderService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service

public class CustomerElderImpI implements CustomerElderService {
    @Autowired
    private CustomerElderMapper customerElderMapper;
    //护理项目分页查询
    @Override
    public PageResponse<NursingProjectVo> getByPage(String name, Integer pageNum, Integer pageSize, Integer status) {
        PageHelper.startPage(pageNum,pageSize);
        Page<NursingProjectVo>page=customerElderMapper.getByPage(name,pageNum,pageSize,status);
        PageResponse<NursingProjectVo> pageResponse=new PageResponse<>(page);
        pageResponse.setRecords(page.getResult());
        return pageResponse;
    }

    @Override
    public NursingProject getById(Long id) {
            NursingProject nursingProject=customerElderMapper.getById(id);
        return nursingProject;
    }
}
